<template>
	<view class="container">
		<cu-custom :bgColor="theme.themeClass">
			<block slot="content">首页</block>
		</cu-custom>
		<search :url="'/pages/user/index'" />
		<carousel :swiperList="swiperList" />
		<navBox :navList="cuIconList" />
		<view class="cu-list menu">
			<view class="cu-bar bg-white solid-bottom margin-top">
				<view class="action">
					<text class="cuIcon-title text-orange"></text>热门商品
				</view>
				<view class="action" @tap="uploadFile">
					<view class="cu-tag round bg-blue light">查看更多</view>
				</view>
			</view>
		</view>
		<navBox :navList="cuIconList" />
		<navBox :navList="cuIconList" />
	</view>
</template>

<script>
	import carousel from '@/components/carousel/carousel.vue'
	import search from '@/components/search/search.vue'
	import navBox from '@/components/navBox/navBox.vue'
	export default {
		components:{
			carousel,
			search,
			navBox
		},
		data() {
			return {
				theme: this.theme,
				cuIconList: [{
					cuIcon: 'cardboardfill',
					color: 'red',
					badge: 120,
					name: 'VR'
				}, {
					cuIcon: 'recordfill',
					color: 'orange',
					badge: 1,
					name: '录像'
				}, {
					cuIcon: 'picfill',
					color: 'yellow',
					badge: 0,
					name: '图像'
				}, {
					cuIcon: 'noticefill',
					color: 'olive',
					badge: 22,
					name: '通知'
				}, {
					cuIcon: 'upstagefill',
					color: 'cyan',
					badge: 0,
					name: '排行榜'
				}, {
					cuIcon: 'clothesfill',
					color: 'blue',
					badge: 0,
					name: '皮肤'
				}, {
					cuIcon: 'discoverfill',
					color: 'purple',
					badge: 0,
					name: '发现'
				}, {
					cuIcon: 'questionfill',
					color: 'mauve',
					badge: 0,
					name: '帮助'
				}, {
					cuIcon: 'commandfill',
					color: 'purple',
					badge: 0,
					name: '问答'
				}, {
					cuIcon: 'brandfill',
					color: 'mauve',
					badge: 0,
					name: '版权'
				}],
				avatar: [
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big81005.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big25002.jpg',
					'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg',
				],
				swiperList:[{
						id: 0,
						type: 'image',
						url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big84000.jpg'
					}, {
						id: 1,
						type: 'image',
						url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big37006.jpg',
					}, {
						id: 2,
						type: 'image',
						url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big39000.jpg'
					}, {
						id: 3,
						type: 'image',
						url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big10001.jpg'
					}, {
						id: 4,
						type: 'image',
						url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big25011.jpg'
					}, {
						id: 5,
						type: 'image',
						url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big21016.jpg'
					}, {
						id: 6,
						type: 'image',
						url: 'https://ossweb-img.qq.com/images/lol/web201310/skin/big99008.jpg'
					}] 

			};
		},
		methods: {
			uploadFile(){
				// this.$api.WechatMaterial({name:'ces',age:76,content:null}).then(response=>{
				// 	console.info("response",response);
				// }).catch(error=>{
				// 	console.info("error",error);
				// })
				this.$api.uploadFile().then(response=>{
					console.info("response",response);
				}).catch(error=>{
					console.info("error",error);
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
